-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PIR] pir onednn add conv_bias_pass #61137
[PIR] pir onednn add conv_bias_pass #61137
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
… pir_onednn_conv_bias_pass
… pir_onednn_conv_bias_pass
def setUp(self): | ||
self.places.append(paddle.CPUPlace()) | ||
# todo(bukejiyu): This pass will support accuracy verification in the future | ||
self.skip_accuracy_verification = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这里精度验证也是失败的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我抄的别人的,这里关掉。我以为全关掉呢。我给打开了。
@@ -0,0 +1,167 @@ | |||
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
add_custom_command( | ||
OUTPUT ${onednn_op_creator_file} | ||
COMMAND | ||
${PYTHON_EXECUTABLE} ${op_creator_gen_file} --op_yaml_files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onednn op的创建也需要op_yaml_files吗?这里的逻辑和53-69行的逻辑是不是在创建pd op的部分重复了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onednn op的创建也需要op_yaml_files。因为ops_onednn_extra.yaml中只有补充信息,主要的OP信息还是在原来的ops.yaml中,需要复用。
pat.Tensor("add_out") = add(pat.Tensor("conv2d_out"), pat.Tensor("bias")); | ||
|
||
pat.RequireNativeCall([&](const paddle::drr::MatchContext &match_ctx) { | ||
std::set<std::string> padding_algorithm = {"EXPLICIT", "SAME", "VALID"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unordered_set或者vector是不是就可以?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得,这里还是set最适合。
std::set<std::string> padding_algorithm = {"EXPLICIT", "SAME", "VALID"}; | ||
std::set<std::string> data_format = {"NCHW", "NHWC", "AnyLayout"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
Others
Description
Pcard-67164
PIR-OneDNN的首个Pass。
建立相关机制。完成conv2d_bias_fuse_pass的开发和测试。
conv2d_bias_fuse_pass等同于老静态图中的paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc里的conv_bias_mkldnn_fuse_pass。